import Vue from 'vue'
import App from './App'
import store from './store' // store
import plugins from './plugins' // plugins
import './permission' // permission
Vue.use(plugins)
import wx from 'weixin-js-sdk'
Vue.prototype.$wx =wx;
Vue.config.productionTip = false
Vue.prototype.$store = store

App.mpType = 'app'
//防止重复点击
const preventReClick = Vue.directive('preventReClick', {
  inserted: function (el, binding) {
    el.addEventListener('click', (e) => {
      if (!el.disabled) {
        el.style.pointerEvents = 'none';
        setTimeout(() => {
          el.style.pointerEvents = 'auto'
        }, binding.value || 2000)
      } else {
        // disabled为true时，阻止默认的@click事件
        e.preventDefault();
        e.stopPropagation()
      }
    }, true)
  }
});
export {preventReClick}
const app = new Vue({
  ...App
})

app.$mount()
